//
//  WCImageDownloader.m
//  WeboCon
//
//  Created by black sun on 12-3-6.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "WCImageDownloader.h"

@implementation WCImageDownloader

-(void)downloadImageFrom:(NSString *)imageUrl{
    ASIHTTPRequest *request = [WCApiRequest getRequestWithApiURL:imageUrl needOAuth:YES];
    request.delegate = self;
    [workingRequest addObject:request];
    [request startSynchronous];
}


-(void)requestSuccess:(ASIHTTPRequest *)request withJSON:(NSDictionary *)json{
    [self.delegate requestDidFinishedWithResult:[[NSImage alloc] initWithData:request.responseData] andUserInfo:request.userInfo];
}

@end
